<?php
namespace Api\Controller;
use Think\Controller;


class IndexController extends Controller {
	
    public function index(){
		
		$account['modules'] = array();
		//$account = M('Wechats')->find();
		//找到所有微信的信息
		$array_row = M('Options')->where(array('option_name'=>'weixin_array'))->find();
		$array_welcome = M('Options')->where(array('option_name'=>'welcome'))->find();
		$array_default = M('Options')->where(array('option_name'=>'default'))->find();
		
		$array_row = unserialize($array_row['option_value']);
		$account    = $array_row;
		
		
		$welcome   = $array_welcome['option_value'];
		$account['welcome']   = $welcome;
		
		$default              = $array_default['option_value'];
		$account['defaults']  = $default;
		
		$account['siteroot'] = "http://".$_SERVER['HTTP_HOST'];
		import('Vendor.Wechat.engine');
		$engine = new \WeEngine($account);
		$engine -> start();
    }
	
	
	 
	
}